1. Field of the Invention.
The present invention generally relates to a computer-implemented database management system, and in particular, to a method for exchanging information in a tuplespace.
2. Description of Related Art.
A Tuplespace is a globally shared, associatively addressed memory space that is organized as a grouping of tuples. The Tuplespace concept is further described in the following: David Gelernter and Arthur J. Bernstein, "Distributed Communication via Global Buffer," PODC 1982, pp. 10-18, 1982 (hereinafter referred to as Gelernter 82); Nicholas Carriero and David Gelernter, "Linda in Context," CACM 32(4), pp. 444-458, 1984 (hereinafter referred to as Carriero 84); and David Gelernter, "Generative Communication in Linda," TOPLAS 7(1), pp. 80-112, 1985 (hereinafter referred to as Gelernter 85); all of which are incorporated by reference herein.
The basic element of a Tuplespace system is a tuple, which is simply a vector of typed values or fields. Templates are used to associatively address tuples via matching techniques. A template (or anti-tuple) is similar to a tuple, but some (zero or more) fields in the vector may be replaced by typed placeholders (with no value) called formal fields. A formal field in a template is said to match a tuple field if they have the same type. If the template field is not formal, both fields must also have the same value. A template matches a tuple if they have an equal number of fields and each template field matches the corresponding tuple field.
Table 1 below illustrates some simple tuples and templates.
TABLE 1 __________________________________________________________________________ SIMPLE TUPLE EXAMPLES Does the Sample Does the Sample Match the Match the Template (Float, Template (Float Sample Tuple Description "Hellow World" int) String, 345.0) __________________________________________________________________________ &lt;2.24, "hello A tuple with three fields: (1) a Yes No world", 345&gt; float with the value 2.24, (2) a string with the value "hello world", and (3) an integer with the value 345. &lt;2,24, "hello A tuple with three fields: (1) a No Yes world", 345.0&gt; float with the value 2.24, (2) a string with the value "hello world", and (3) a float with the value 345.0. &lt; &gt; A tuple with 0 fields. No No __________________________________________________________________________
A tuple is created by a process and placed in the Tuplespace via a write primitive. Tuples are read or removed with read and take primitives, which take a template and return the first matching tuple. (Note that, because the space is unstructured, the choice among multiple matching tuples is arbitrary and implementation-dependent.) Most Tuplespace implementations provide both blocking and non-blocking versions of the tuple retrieval primitives. A blocking read, for example, waits until a matching tuple is found in the Tuplespace, while a non-blocking version will return a "tuple not found" value if no matching tuple is immediately available.
Tuplespace provides a simple yet powerful mechanism for inter-process communication and synchronization, which is the crux of parallel and distributed programming. A process with data to share "generates" a tuple and places it into the Tuplespace. A process requiring data simply requests a tuple from the space. Although not quite as efficient as message-passing systems, Tuplespace programs are typically easier to write and maintain, for a number of reasons:
Destination uncoupling (fully anonymous communication): Most message passing systems are partially anonymous: it is not necessary for the receiver of a message to identify the sender, but the sender always has to specify the receiver. The creator of a tuple, however, requires no knowledge about the future use of that tuple, or its destination. PA1 Space uncoupling: Since tuples are retrieved using an associative addressing scheme, multiple address-space-disjoint processes access tuples in the same way. PA1 Time uncoupling: Tuples have their own lifespan, independent of the processes that generated them, or any processes that may read them. This enables time-disjoint processes to communicate seamlessly.
Tuplespace extends message passing systems with a simple data repository that features associated addressing. Conceptually, it ranks above a pure message passing system in terms of function, but far below relational database systems, since most implementations do not include transactions, persistence or any significant form of query facility.
Research into Tuplespace systems has proceeded at a steady pace for the past fifteen years, but has been primarily targeted at the high-performance parallel computing market. Recently, interest in Tuplespace has developed among researchers in distributed systems.
For example, SUN Microsystems has recently publicized an internal project based on Tuplespaces, called "Javaspaces", as described in the JavaSpace.TM. Specification, Revision 0.4, Sun Microsystems, Inc., 1997, which is incorporated by reference herein. Also, computer science departments at universities around the country are now giving programming assignments that feature Tuplespaces in Java.TM..
Notwithstanding these improvements, there remains a need in the art for enhanced functionality for use with Tuplespaces. The present invention provides such enhanced functionality directed to the exchange of information between clients or processes using a Tuplespace.